# process  and  system
import psutil
# 第三方模块

import multiprocessing
print(multiprocessing.cpu_count())

print(psutil.users())

#        API     接口
#    应用程序界面
#   Application Program Interface

#  先用假数据,保持程序的正常运行;
#  等到真数据,直接替换

# [suser(name='Dancy陈',
#        terminal=None, host='0.0.0.0',
#        started=1562768342.0, pid=None)]


print(psutil.cpu_times())
# scputimes(user=17958.046875, system=10347.906250000058,
#     idle=365486.81249999994, interrupt=686.421875, dpc=685.265625)
# for i in range(1,10):
#     print(psutil.cpu_percent(interval=1,percpu=True))

print(type(psutil.cpu_count()))
#                      True
#                   逻辑
print(psutil.cpu_count(False))
#                  内核


print('freq--------->',psutil.cpu_freq())
print('percent--------->',psutil.cpu_percent(interval=1,percpu=True))
print('swap_memory--------->',psutil.swap_memory())
print('disk_usage--------->',psutil.disk_usage('D:'))
# scpufreq(current=2208.0, min=0.0, max=2208.0)
print(psutil.cpu_stats())
# scpustats(ctx_switches=872678214,
#       interrupts=593450905, soft_interrupts=0,
#       syscalls=3720198169)
import time
print(psutil.boot_time())
print(time.time())